package org.ccams.dao;

import java.util.List;

import org.ccams.domain.TProductplan;
import org.ccams.util.PageParameter;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class TProductplanDAO extends SqlMapClientDaoSupport {

	/**
	 * 返回指定页码的数据
	 * 
	 * @return
	 */
	@SuppressWarnings( { "unchecked", "deprecation" })
	public List<TProductplan> getTProductplan(PageParameter pageParmeter) {
		return getSqlMapClientTemplate().queryForList("getTProductplanByPage",
				pageParmeter);
	}

	public int getTproductplanCount() {
		int count = 0;
		count = (Integer) getSqlMapClientTemplate().queryForObject(
				"getTProductplanCount");
		return count;
	}

	public int deleteByPrimaryKey(String id) {
		return getSqlMapClientTemplate().update("delectTProductplan", id);
	}

	public int insert(TProductplan tproductPlan) {
		return getSqlMapClientTemplate().update("abatorgenerated_insert",
				tproductPlan);
	}

	public int updateTproductplan(TProductplan tproductPlan) {
		return getSqlMapClientTemplate().update("updateTproductplan",
				tproductPlan);
	}
}